# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name:        my_report
# Purpose:
#
# Author:      ASTRI IoT
#
# Created:     19-09-2013
# Copyright:   (c) ASTRI 2013
# Licence:     AGPL
#-------------------------------------------------------------------------------
from openerp.osv import fields,osv
from openerp import tools
import time
 
class my_report_model(osv.osv):
    _name = "my.report.model"
    _description = "My Report"
    _columns = {
        'child_name': fields.char('Analytic Account', size=128, readonly=True),
        'parent_name': fields.char('Analytic Account - Parent', size=128, readonly=True),
        'date_from': fields.date('Start Date', readonly=True),
        'date_to': fields.date('End Date', readonly=True),
        'planned_amount': fields.float('Planned Amount', readonly=True)
    }
    _order = 'parent_name asc, child_name asc'
    _default = { 
        'date_from': fields.date.context_today,
        'date_to': fields.date.context_today,
        }

    def default_get(self, cr, uid, fields, context=None):
        res = super(my_report_model, self).default_get(cr, uid, fields, context=context)
        res['child_name'] = 'initial value test'
        res['parent_name'] = 'initial value test'
        res['planned_amount'] = 9999
        return res

my_report_model()
